import type { OperateActReProcdefReq, QueryActReProcdefReq, QueryDynamicParametersReq, QueryImageOrXmlReq, StartProcessReq } from './actReProcdefType'
import request from '@/utils/http/request'

// 分页查询部署定义信息
export function pageActReProcdef(data: QueryActReProcdefReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/actReProcdef/page',
    data,
  })
}

// 激活/挂起流程定义
export function operateActReProcdef(data: OperateActReProcdefReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/actReProcdef/operate',
    data,
  })
}

// 查询流程图
export function queryImage(data: QueryImageOrXmlReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/actReProcdef/queryImage',
    data,
  })
}

// 查询流程定义的xml
export function queryXml(data: QueryImageOrXmlReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/actReProcdef/queryXml',
    data,
  })
}

// 查询动态参数
export function queryDynamicParameters(data: QueryDynamicParametersReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/actReProcdef/queryDynamicParameters',
    data,
  })
}

// 带着动态参数启动流程实例
export function startProcess(data: StartProcessReq) {
  return request.post<any>({
    url: '/pm-process/api/v1/actReProcdef/startProcess',
    data,
  })
}
